﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/default.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="NRCP.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/Highcharts/js/highcharts.js" type="text/javascript"></script>
    <script type="text/javascript">
        var chart;
        $(document).ready(function () {
            LoadSummary();
            
        });

        function LoadSummary() {
            $.ajax({
                type: "POST",
                url: "App_Service/SiteDataUtility.asmx/ReportGetOpenPlan",
                beforeSend: function () { $("#wait").show(); },
                complete: function () { $("#wait").hide(); },
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var summaryStore = data.d;
                    BindSummary(summaryStore);

                },
                error: function (msg) {
                    alert(msg);
                }
            });
        }

        function BindSummary(store) {
                      
            chart = new Highcharts.Chart({
                chart: {
                    renderTo: 'divSummary',
                    type: 'column'
                },
                title: {
                    text: 'Sample Collection Summary By Year'
                },
                
                xAxis: {
                    categories: eval(store[0])
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: 'Rainfall (mm)'
                    }
                },
                legend: {
                    layout: 'vertical',
                    backgroundColor: '#FFFFFF',
                    align: 'left',
                    verticalAlign: 'top',
                    x: 100,
                    y: 70,
                    floating: true,
                    shadow: true
                },
                tooltip: {
                    formatter: function () {
                        return this.y + ' ' + this.series.name + ' Samples in year ' + this.x;
                    }
                },
                plotOptions: {
                    column: {
                        pointPadding: 0.2,
                        borderWidth: 0
                    }
                },
                series: eval(store[1])
            });

        }

       
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%--    <br class="clearfix" />
    <div class="grid_12 report-title-sub clarfix alpha">
        Farmers Statistics
    </div>
    <div class="grid_24  dash-bar-2 dash-bar-3 block-gray alpha">
        <div class="blocks border1 grid_6 block-parent alpha">
            <div class="dash-bar-1-value">
                1500</div>
            <div class="dash-bar-1-title">
                Total</div>
        </div>
        <div class="blocks border1 grid_6">
            <div class="dash-bar-1-value">
                890</div>
            <div class="dash-bar-1-title">
                Satisfactory</div>
        </div>
        <div class="blocks border2 grid_6">
            <div class="dash-bar-1-value">
                710</div>
            <div class="dash-bar-1-title">
                Not Satisfactory</div>
        </div>
    </div>--%>
    <br class="clearfix" />
    <div class="grid_20 alpha">
        <div id="divSummary" class="grid_20 alpha">
        </div>
       
    </div>
    <div class="grid_4 da-panel omega">
        <div class="da-panel-content">
            <h6>
                System Stats</h6>
            <ul class="da-summary-stat">
                <li><span style="background-color: #e15656;" class="da-summary-icon"><i
                    class="icon-numbers">
                    <asp:Literal ID="litFarms" runat="server"></asp:Literal></i></span><span class="da-summary-text"> <span class="text">
                        Farms</span> </span></li>
                <li><span style="background-color: #a6d037;" class="da-summary-icon"><i
                    class="icon-numbers">
                    <asp:Literal ID="litUpazila" runat="server"></asp:Literal></i></span><span class="da-summary-text"> <span class="text">
                        Upazila</span> </span></li>
                <li><span style="background-color: #ea799b;" class="da-summary-icon"><i
                    class="icon-numbers">
                    <asp:Literal ID="litPlans" runat="server"></asp:Literal></i></span><span class="da-summary-text"> <span class="text">
                        Plans</span> </span></li>
                <li><span style="background-color: #fab241;" class="da-summary-icon"><i
                    class="icon-numbers">
                    <asp:Literal ID="litSamples" runat="server"></asp:Literal></i></span><span class="da-summary-text"><span class="text">Samples</span>
                    </span></li>
                <li><span style="" class="da-summary-icon"><i class="icon-numbers">
                    <asp:Literal ID="litNonComplience" runat="server"></asp:Literal></i></span>
                    <span class="da-summary-text"><span class="text">Non Complience</span> </span>
                </li>
            </ul>
        </div>
    </div>
</asp:Content>
